﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SampleSite.UserControls
{
    public partial class ExampleList : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            DirectoryInfo root = new DirectoryInfo(HttpContext.Current.Server.MapPath("~/Examples/"));
            var pages = root.GetFiles("*.aspx").Select(f => new { Name = Utilities.AutoFileName(f.Name), Url = "~/Examples/" + f.Name });
            ListView1.DataSource = pages;
            ListView1.DataBind();
        }
    }
}